package com.tuishan.myapplication.Custom;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

import com.tuishan.myapplication.R;

/**
 * <pre>
 *     time   : 2021/04/08
 *     desc   :
 *     version: 1.0
 * </pre>
 */


public class LoadingView extends Dialog {
    private Context mContext;

    public LoadingView(Context context) {
        super(context, R.style.dialogTransparent);
        mContext=context;
        init(context);
    }

    private void init(Context context) {
        View view = View.inflate(context, R.layout.custom_loadview, null);
        setContentView(view);
        Window mWindow = this.getWindow();
        WindowManager.LayoutParams params = mWindow.getAttributes();
        params.width = WindowManager.LayoutParams.MATCH_PARENT;
        params.height= WindowManager.LayoutParams.MATCH_PARENT;
        params.alpha=0.3f;
        mWindow.setAttributes(params);
        this.setCancelable(false);
    }
}